package com.cskaoyan.controller;

import com.cskaoyan.bean.MarketUser;
import com.cskaoyan.bean.common.BasePageInfo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.service.AdminUserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yi
 * @date 2022/10/13 10:53
 */
@RestController
@RequestMapping("admin/user")
public class AdminUserController {
    @Autowired
    AdminUserServer adminUserServer;

    @RequestMapping("list")
    public BaseRespVo list(String username, String mobile, BasePageInfo basePageInfo) {
        CommonData<MarketUser> data = adminUserServer.queryUser(username, mobile, basePageInfo);
        return BaseRespVo.ok(data, "成功");
    }

    @RequestMapping("detail")
    public BaseRespVo detail(Integer id) {
        MarketUser marketUser = adminUserServer.queryUserById(id);
        return BaseRespVo.ok(marketUser, "成功");
    }
}
